#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char **argv)
{
	
	int fd;
	if((fd=open("./data", O_RDWR))==-1)
	{
		perror("Cannot open file!");
		exit(1);
	}

	lseek(fd, 1000, SEEK_END);

	char buf[21]= "hello";

	int count = write(fd, buf, strlen(buf));
	printf("%s  %d\n", buf, count);

	close(fd);

	return 0;
}
